package com.gotloop.jpa;

import java.util.Date;
import java.util.List;

import javax.jdo.annotations.Persistent;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import com.gotloop.enu.Role;
import com.gotloop.jdo.Comment;
import com.gotloop.jdo.Loop;

public class UserProfile {

	@Id
	private Long uid;

	/**
	 * Comments made.
	 */
	@Persistent(mappedBy = "author")
	private List<Comment> comments;

	/**
	 * Date of creation.
	 */
	@Persistent
	private Date creationDate;

	/**
	 * User description.
	 */
	@Persistent
	private String description;

	/**
	 * User email.
	 */
	@Persistent
	private String email;

	/**
	 * User name.
	 */
	@Persistent
	private String name;

	/**
	 * User password.
	 */
	@Persistent
	private String pass;

	/**
	 * user role (ADMIN,USER,GUEST).
	 */
	private Role role;

	/**
	 * User website url.
	 */
	private String site;

	/**
	 * Loops uploaded by User.
	 */
	private List<Loop> uploadedLoops;

	private Date creation;

	/**
	 * user last connection date.
	 * Used to purge user table (>12months).
	 */
	@Persistent
	private Date lastConnection;

	private Date deletion;
}
